#pragma once

#include "KeyInfo.h"

#include <memory>
#include <QByteArray>

namespace kryptos { namespace cryptography {

class PublicKey
{
public:
    PublicKey();
    PublicKey(const QByteArray keyData, const kryptos::entities::KeyInfo &info);
    virtual ~PublicKey();

    const QByteArray key() const;

    kryptos::entities::KeyInfo info() const;

    PublicKey& operator=(const PublicKey &pk);

protected:

    QByteArray                   m_key;
    kryptos::entities::KeyInfo   m_info;

};

class KeyGenerator;

class PrivateKey : public PublicKey
{
public:
   PrivateKey();
   PrivateKey(const QByteArray privatekeyData, const QByteArray publickeyData, const kryptos::entities::KeyInfo &info);
   virtual ~PrivateKey();

   PublicKey publicKeyPart() const;

   void setPassphrase(std::string passphrase);

   PrivateKey& operator=(const PrivateKey &pk);

protected:

   friend class KeyGenerator;


   PublicKey m_publicPart;

};

}}
